package com.my.producer.controller;

import com.my.common.R;
import com.my.producer.entiry.Girl;
import com.my.producer.service.GirlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description:
 * @author: marshal
 * @date: 2021-07-14 2:07 PM
 */
@RequestMapping("/girl")
@RestController
public class GirlController {

    @Autowired
    private GirlService girlService;

    @PostMapping("/save")
    public R<Girl> save(@RequestBody Girl girl) {
        girlService.save(girl);
        return R.ok(girl);
    }

    @GetMapping("/query/{id}")
    public R<Girl> query(@PathVariable("id") int id) {
        return R.ok(girlService.getById(id));
    }

}
